package com.pig.pojo.order;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.pig.pojo.addr.Addr;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

@TableName("p_order")
public class Order implements Serializable {

    @TableField(exist=false)	//入库操作忽略该字段
    private List<OrderItem> orderItem;
    private List<Addr> addrs;

    private String orderId;         //订单id
    private Integer userId;            //会员id
    private Integer addrId;            //地址id
    private Integer totalAmount;       //订单总金额
    private Integer payAmount;         //实际支付支付金额
    private Integer freightAmount;     //运费金额
    private Integer promotionAmount;   //促销金额(优惠金额)
    private String payType;           //支付方式
    private Integer status;//订单状态 0待付款；1->待发货；2->已发货；3->已完成；4->已关闭；5->无效订单',
    private String deliveryCompany; //配送方式
    private Integer confirmStatus;     //'确认收货状态：0->未确认；1->已确认'
    private Date createTime;        //创建订单时间
    private Date paymentTime;       //支付时间
    private Date deliveryTime;      //发货时间
    private Date receiveTime;       //确认收货时间

    public List<Addr> getAddr(){return addrs;}

    public void setAddrs(List<Addr> addrs){this.addrs=addrs;}

    public List<OrderItem> getOrderItem() {
        return orderItem;
    }

    public void setOrderItems(List<OrderItem> orderItem) {
        this.orderItem = orderItem;
    }

    public Order() {

    }

    public Order(String orderId, Integer userId, Integer addrId, Integer totalAmount, Integer payAmount, Integer freightAmount, Integer promotionAmount, String payType, Integer status, String deliveryCompany, Integer confirmStatus, Date createTime, Date paymentTime, Date deliveryTime, Date receiveTime) {
        this.orderId = orderId;
        this.userId = userId;
        this.addrId = addrId;
        this.totalAmount = totalAmount;
        this.payAmount = payAmount;
        this.freightAmount = freightAmount;
        this.promotionAmount = promotionAmount;
        this.payType = payType;
        this.status = status;
        this.deliveryCompany = deliveryCompany;
        this.confirmStatus = confirmStatus;
        this.createTime = createTime;
        this.paymentTime = paymentTime;
        this.deliveryTime = deliveryTime;
        this.receiveTime = receiveTime;
    }

    @Override
    public String toString() {
        return "Order{" +
                "orderId='" + orderId + '\'' +
                ", userId=" + userId +
                ", addrId=" + addrId +
                ", totalAmount=" + totalAmount +
                ", payAmount=" + payAmount +
                ", freightAmount=" + freightAmount +
                ", promotionAmount=" + promotionAmount +
                ", payType=" + payType +
                ", status=" + status +
                ", deliveryCompany='" + deliveryCompany + '\'' +
                ", confirmStatus=" + confirmStatus +
                ", createTime=" + createTime +
                ", paymentTime=" + paymentTime +
                ", deliveryTime=" + deliveryTime +
                ", receiveTime=" + receiveTime +
                '}';
    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Integer getAddrId() {
        return addrId;
    }

    public void setAddrId(Integer addrId) {
        this.addrId = addrId;
    }

    public Integer getTotalAmount() {
        return totalAmount;
    }

    public void setTotalAmount(Integer totalAmount) {
        this.totalAmount = totalAmount;
    }

    public Integer getPayAmount() {
        return payAmount;
    }

    public void setPayAmount(Integer payAmount) {
        this.payAmount = payAmount;
    }

    public Integer getFreightAmount() {
        return freightAmount;
    }

    public void setFreightAmount(Integer freightAmount) {
        this.freightAmount = freightAmount;
    }

    public Integer getPromotionAmount() {
        return promotionAmount;
    }

    public void setPromotionAmount(Integer promotionAmount) {
        this.promotionAmount = promotionAmount;
    }

    public String getPayType() {
        return payType;
    }

    public void setPayType(String payType) {
        this.payType = payType;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getDeliveryCompany() {
        return deliveryCompany;
    }

    public void setDeliveryCompany(String deliveryCompany) {
        this.deliveryCompany = deliveryCompany;
    }

    public Integer getConfirmStatus() {
        return confirmStatus;
    }

    public void setConfirmStatus(Integer confirmStatus) {
        this.confirmStatus = confirmStatus;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getPaymentTime() {
        return paymentTime;
    }

    public void setPaymentTime(Date paymentTime) {
        this.paymentTime = paymentTime;
    }

    public Date getDeliveryTime() {
        return deliveryTime;
    }

    public void setDeliveryTime(Date deliveryTime) {
        this.deliveryTime = deliveryTime;
    }

    public Date getReceiveTime() {
        return receiveTime;
    }

    public void setReceiveTime(Date receiveTime) {
        this.receiveTime = receiveTime;
    }
}
